package com.xnyzc.lhy.common.penum.driver.info;

/**
 * @Description 司机类型（0：个人；1：车队）
 * @Author zhuyubin
 * @Date 2019-08-29 02:01
 **/
public enum EOaDUserDriverType {

    personal(0, "个人"),
    fleet(1, "车队"),
    proprietary(2, "自营车辆"),
    join(3, "带车加盟");

    private Integer value;
    private String desc;

    EOaDUserDriverType(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static EOaDUserDriverType findById(Integer type) {
        EOaDUserDriverType ePaymentType;
        switch (type) {
            case 0:
                ePaymentType = EOaDUserDriverType.personal;
                break;
            case 1:
                ePaymentType = EOaDUserDriverType.fleet;
                break;
            case 2:
                ePaymentType = EOaDUserDriverType.proprietary;
                break;
            case 3:
                ePaymentType = EOaDUserDriverType.join;
                break;
            default:
                throw new IllegalArgumentException("未设置");
        }
        return ePaymentType;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }
}
